#include <iostream>
#include "ThreadPool.hpp"
#include <memory>
#include "Task.hpp"
#include <ctime>
#include <sys/types.h>
#include <unistd.h>

using namespace std;

int main()
{
    unique_ptr<ThreadPool<Task>> tp(new ThreadPool<Task>());
    tp->Start();
    srand((uint64_t)time(nullptr) ^ getpid());

    while(true)
    {
        int x = rand() % 10;
        int y = rand() % 10;
        char op = opers[rand() % opers.size()];
        Task t(x, y, op);
        tp->Push(t);
        // cout << "make task: " << t.PrintTask() << endl;
        sleep(1);
    }

    tp->Wait();
    return 0;
}